
// requires....
var index = require('./controller/index'); //TODO
var sign = require('./controller/sign'); //TODO
//var search = require('./controller/search'); //TODO
var product = require('./controller/product'); //TODO
var vendor = require('./controller/vendor');
    module.exports = function(app){
        // Home page
        app.get('/', index);
        
        // Sign up, in, out
        app.get('/signup', sign.showSignup); // Goes to signup page
        app.post('/signup', sign.signup); // Post signup info
        app.get('/signout', sign.signout); //Delete cookies, redirect to home page
        app.get('/signin', sign.showSignin); // Goes to login page
        app.post('/signin', sign.signin); //Post login info
        //
        ////product: Search, browse, buy, order
        app.get('/search', product.search); //Search for a product
        app.get('/product/:productid', product.show); //Goes to a product's detail page.
        app.post('/product/buy', product.buy);//Buy this product
        //app.post('/product/:productid/order', product.order); //Add this product into cart
        //app.vendor('/vendor', vendor.addProduct);
        //test
       // app.get('/test', test);
    }

function test(req,res){
    //req.session.username = req.session.username+'ttt';
    //res.render('test', {session: req.session.username});
   
}   
    
    
    